package com.daisuxia.risk.service;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.daisuxia.back.utils.RequestUtils;
import com.daisuxia.risk.dao.IRiskOrdersDao;
import com.daisuxia.risk.pojo.RiskOrders;

@Service
public class RiskOrdersService implements IRiskOrdersService {
	@Autowired
	private IRiskOrdersDao ordersDao;

	@Override
	public int insert(RiskOrders orders) {
		if (StringUtils.isBlank(orders.getAddIp())) {
			orders.setAddIp(RequestUtils.getIpAddr());
		}
		return ordersDao.insert(orders);
	}

	@Override
	public int update(RiskOrders orders) {
		return ordersDao.update(orders);
	}

	@Override
	public RiskOrders findById(Integer id) {
		return ordersDao.findById(id);
	}
}
